<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="show"></div>
<script>
    function sum(...args)
    {
        let arr = [...args];
        let sum = arr.reduce((pre,item)=>{
            return pre+item;
        },0);
        return sum;
    }
     
    const els = document.querySelector('#show');
    els.textContent = sum(1,3,3,4,51,4);
</script>
</body>
</html>